#ifndef RTMPHANDLE_H
#define RTMPHANDLE_H

#include "define.h"
#include "XVideoCapture.h"

class IRtmpEvent
{
public:
    virtual void OnReadVideo(QImage image) = 0;
};

class RtmpHandle: public QThread, IVideoCaptureEvent
{

public:
    RtmpHandle();

    virtual ~RtmpHandle();
    void SetObserver(IRtmpEvent * ob){mEvent = ob;}
    void OnReadFrame(QImage image) override;
    void SetRtmpUrl(string url){ mRtmpUrl = url;}
    void StopAll();

protected:
   void run() override;

private:
   int sendRtmpData();

private:
   IRtmpEvent* mEvent;   
   string mRtmpUrl;
   bool isExit;
};

#endif // RTMPHANDLE_H
